home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Sound / LAME / WarpOS / src / aclocal.m4 < prev    next >
Encoding:
M4 Source File  |  2001-03-12  |  41.5 KB  |  1,288 lines

  1. # aclocal.m4 generated automatically by aclocal 1.4d
  2.  
  3. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
  4. # Free Software Foundation, Inc.
  5. # This file is free software; the Free Software Foundation
  6. # gives unlimited permission to copy and/or distribute it,
  7. # with or without modifications, as long as this notice is preserved.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  11. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  12. # PARTICULAR PURPOSE.
  13.  
  14. dnl acinclude.m4. Change *this* file to add new or change macros.
  15. dnl When changes have been made, delete aclocal.m4 and run
  16. dnl "aclocal".
  17. dnl
  18. dnl DO NOT change aclocal.m4 !
  19. dnl
  20.  
  21. dnl * LA_SEARCH_FILE(variable, filename, PATH)
  22. dnl * Search "filename" in the specified "PATH", "variable" will 
  23. dnl * contain the full pathname or the empty string
  24. dnl * PATH is space-separated list of directories.
  25. dnl * by Florian Bomers
  26.  
  27. AC_DEFUN(LA_SEARCH_FILE,[
  28.   $1=
  29.   dnl hack: eliminate line feeds in $2
  30.   for FILE in $2; do
  31.     for DIR in $3; do
  32.       dnl use PATH in order
  33.       if test ".$1"="." && test -f "$DIR/$FILE"; then
  34.         $1=$DIR
  35.       fi
  36.     done
  37.   done
  38. ])
  39.  
  40. dnl * LA_SEARCH_LIB(lib-variable, include-variable, lib-filename, header-filename, prefix)
  41. dnl * looks for "lib-filename" and "header-filename" in the area of "prefix".
  42. dnl * if found, "lib-variable" and "include-variable" are set to the
  43. dnl * respective paths.
  44. dnl * prefix is a single path
  45. dnl * libs are searched in prefix, prefix/lib, prefix/.., prefix/../lib
  46. dnl * headers are searched in prefix, prefix/include, prefix/.., prefix/../include
  47. dnl * 
  48. dnl * If one of them is not found, both "lib-variable", "include-variable" are 
  49. dnl * set to the empty string.
  50. dnl *
  51. dnl * TODO: assert function call to verify lib
  52. dnl *
  53. dnl * by Florian Bomers
  54.  
  55. AC_DEFUN(LA_SEARCH_LIB,[
  56.   dnl look for lib
  57.   LA_SEARCH_FILE($1, $3, $5 $5/lib $5/.. $5/../lib)
  58.   dnl look for header.
  59.   LA_SEARCH_FILE($2, $4, $5 $5/include $5/.. $5/../include)
  60.   if test ".$1" = "." || test ".$2" = "."; then
  61.     $1=
  62.     $2=
  63.   fi
  64. ])
  65.  
  66.  
  67.  
  68.  
  69. # alex_IEEE854_FLOAT80
  70. # ------------
  71. AC_DEFUN(alex_IEEE854_FLOAT80,
  72. [AC_CACHE_CHECK(for IEEE854 compliant 80 bit floats, alex_cv_ieee854_float80,
  73. [AC_TRY_RUN([
  74. int   float2long_IEEE_compliance ( void )
  75. {
  76.     float  f;
  77.     f = 12582912.; if ( *(long*)(&f) != 1262485504l ) return 0;
  78.     f = 12615679.; if ( *(long*)(&f) != 1262518271l ) return 0;
  79.     f = 13582912.; if ( *(long*)(&f) != 1263485504l ) return 0;
  80.     f = 12550145.; if ( *(long*)(&f) != 1262452737l ) return 0;
  81.     f = 11582912.; if ( *(long*)(&f) != 1261485504l ) return 0;
  82.     return 1;
  83. }
  84.  
  85. int main(void)
  86. {
  87.     int retval;
  88.  
  89.     retval = float2long_IEEE_compliance();
  90.  
  91.     /* no error return -> success */
  92.     return !retval;
  93. }
  94. ], alex_cv_ieee854_float80=yes, alex_cv_ieee854_float80=no,
  95. [AC_MSG_WARN(can't check for IEEE854 compliant 80 bit floats)]
  96. )])]) # alex_IEEE854_FLOAT80
  97.  
  98.  
  99.  
  100. # Do all the work for Automake.  This macro actually does too much --
  101. # some checks are only needed if your package does certain things.
  102. # But this isn't really a big deal.
  103.  
  104. # serial 5
  105.  
  106. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
  107. # written in clear, in which case automake, when reading aclocal.m4,
  108. # will think it sees a *use*, and therefore will trigger all it's
  109. # C support machinery.  Also note that it means that autoscan, seeing
  110. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  111.  
  112.  
  113. # We require 2.13 because we rely on SHELL being computed by configure.
  114. AC_PREREQ([2.13])
  115.  
  116. # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
  117. # -----------------------------------------------------------
  118. # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
  119. # The purpose of this macro is to provide the user with a means to
  120. # check macros which are provided without letting her know how the
  121. # information is coded.
  122. # If this macro is not defined by Autoconf, define it here.
  123. ifdef([AC_PROVIDE_IFELSE],
  124.       [],
  125.       [define([AC_PROVIDE_IFELSE],
  126.               [ifdef([AC_PROVIDE_$1],
  127.                      [$2], [$3])])])
  128.  
  129.  
  130. # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
  131. # ----------------------------------------------
  132. AC_DEFUN([AM_INIT_AUTOMAKE],
  133. [AC_REQUIRE([AC_PROG_INSTALL])dnl
  134. # test to see if srcdir already configured
  135. if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
  136.    test -f $srcdir/config.status; then
  137.   AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
  138. fi
  139.  
  140. # Define the identity of the package.
  141. PACKAGE=$1
  142. AC_SUBST(PACKAGE)dnl
  143. VERSION=$2
  144. AC_SUBST(VERSION)dnl
  145. ifelse([$3],,
  146. [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  147. AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
  148.  
  149. # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
  150. # the ones we care about.
  151. ifdef([m4_pattern_allow], [m4_pattern_allow([AM_CFLAGS])])
  152. ifdef([m4_pattern_allow], [m4_pattern_allow([AM_CPPFLAGS])])
  153. ifdef([m4_pattern_allow], [m4_pattern_allow([AM_CXXFLAGS])])
  154. ifdef([m4_pattern_allow], [m4_pattern_allow([AM_OBJCFLAGS])])
  155. ifdef([m4_pattern_allow], [m4_pattern_allow([AM_FFLAGS])])
  156. ifdef([m4_pattern_allow], [m4_pattern_allow([AM_RFLAGS])])
  157. ifdef([m4_pattern_allow], [m4_pattern_allow([AM_GCJFLAGS])])
  158.  
  159. # Some tools Automake needs.
  160. AC_REQUIRE([AM_SANITY_CHECK])dnl
  161. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  162. AM_MISSING_PROG(ACLOCAL, aclocal)
  163. AM_MISSING_PROG(AUTOCONF, autoconf)
  164. AM_MISSING_PROG(AUTOMAKE, automake)
  165. AM_MISSING_PROG(AUTOHEADER, autoheader)
  166. AM_MISSING_PROG(MAKEINFO, makeinfo)
  167. AM_MISSING_PROG(AMTAR, tar)
  168. AM_MISSING_INSTALL_SH
  169. # We need awk for the "check" target.  The system "awk" is bad on
  170. # some platforms.
  171. AC_REQUIRE([AC_PROG_AWK])dnl
  172. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  173. AC_REQUIRE([AM_DEP_TRACK])dnl
  174. AC_REQUIRE([AM_SET_DEPDIR])dnl
  175. AC_PROVIDE_IFELSE([AC_PROG_][CC],
  176.                   [AM_DEPENDENCIES(CC)],
  177.                   [define([AC_PROG_][CC],
  178.                           defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
  179. AC_PROVIDE_IFELSE([AC_PROG_][CXX],
  180.                   [AM_DEPENDENCIES(CXX)],
  181.                   [define([AC_PROG_][CXX],
  182.                           defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
  183. ])
  184.  
  185. #
  186. # Check to make sure that the build environment is sane.
  187. #
  188.  
  189. # serial 3
  190.  
  191. # AM_SANITY_CHECK
  192. # ---------------
  193. AC_DEFUN([AM_SANITY_CHECK],
  194. [AC_MSG_CHECKING([whether build environment is sane])
  195. # Just in case
  196. sleep 1
  197. echo timestamp > conftest.file
  198. # Do `set' in a subshell so we don't clobber the current shell's
  199. # arguments.  Must try -L first in case configure is actually a
  200. # symlink; some systems play weird games with the mod time of symlinks
  201. # (eg FreeBSD returns the mod time of the symlink's containing
  202. # directory).
  203. if (
  204.    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
  205.    if test "$[*]" = "X"; then
  206.       # -L didn't work.
  207.       set X `ls -t $srcdir/configure conftest.file`
  208.    fi
  209.    if test "$[*]" != "X $srcdir/configure conftest.file" \
  210.       && test "$[*]" != "X conftest.file $srcdir/configure"; then
  211.  
  212.       # If neither matched, then we have a broken ls.  This can happen
  213.       # if, for instance, CONFIG_SHELL is bash and it inherits a
  214.       # broken ls alias from the environment.  This has actually
  215.       # happened.  Such a system could not be considered "sane".
  216.       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
  217. alias in your environment])
  218.    fi
  219.  
  220.    test "$[2]" = conftest.file
  221.    )
  222. then
  223.    # Ok.
  224.    :
  225. else
  226.    AC_MSG_ERROR([newly created file is older than distributed files!
  227. Check your system clock])
  228. fi
  229. rm -f conftest*
  230. AC_MSG_RESULT(yes)])
  231.  
  232.  
  233. # serial 2
  234.  
  235. # AM_MISSING_PROG(NAME, PROGRAM)
  236. # ------------------------------
  237. AC_DEFUN([AM_MISSING_PROG],
  238. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  239. $1=${$1-"${am_missing_run}$2"}
  240. AC_SUBST($1)])
  241.  
  242.  
  243. # AM_MISSING_INSTALL_SH
  244. # ---------------------
  245. # Like AM_MISSING_PROG, but only looks for install-sh.
  246. AC_DEFUN([AM_MISSING_INSTALL_SH],
  247. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  248. if test -z "$install_sh"; then
  249.    for install_sh in "$ac_aux_dir/install-sh" \
  250.                      "$ac_aux_dir/install.sh" \
  251.                      "${am_missing_run}${ac_auxdir}/install-sh";
  252.    do
  253.      test -f "$install_sh" && break
  254.    done
  255.    # FIXME: an evil hack: we remove the SHELL invocation from
  256.    # install_sh because automake adds it back in.  Sigh.
  257.    install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
  258. fi
  259. AC_SUBST(install_sh)])
  260.  
  261.  
  262. # AM_MISSING_HAS_RUN
  263. # ------------------
  264. # Define MISSING if not defined so far and test if it supports --run.
  265. # If it does, set am_missing_run to use it, otherwise, to nothing.
  266. AC_DEFUN([AM_MISSING_HAS_RUN],
  267. [test x"${MISSING+set}" = xset ||
  268.   MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
  269. # Use eval to expand $SHELL
  270. if eval "$MISSING --run :"; then
  271.   am_missing_run="$MISSING --run "
  272. else
  273.   am_missing_run=
  274.   am_backtick='`'
  275.   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
  276. fi
  277. ])
  278.  
  279. # serial 3
  280.  
  281. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
  282. # written in clear, in which case automake, when reading aclocal.m4,
  283. # will think it sees a *use*, and therefore will trigger all it's
  284. # C support machinery.  Also note that it means that autoscan, seeing
  285. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  286.  
  287. # AM_DEPENDENCIES(NAME)
  288. # ---------------------
  289. # See how the compiler implements dependency checking.
  290. # NAME is "CC", "CXX" or "OBJC".
  291. # We try a few techniques and use that to set a single cache variable.
  292. AC_DEFUN([AM_DEPENDENCIES],
  293. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  294. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  295. ifelse([$1], CC,
  296.        [AC_REQUIRE([AC_PROG_][CC])dnl
  297. AC_REQUIRE([AC_PROG_][CPP])
  298. depcc="$CC"
  299. depcpp="$CPP"],
  300.        [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
  301. AC_REQUIRE([AC_PROG_][CXXCPP])
  302. depcc="$CXX"
  303. depcpp="$CXXCPP"],
  304.        [$1], OBJC, [am_cv_OBJC_dependencies_compiler_type=gcc],
  305.        [AC_REQUIRE([AC_PROG_][$1])dnl
  306. depcc="$$1"
  307. depcpp=""])
  308.  
  309. AC_REQUIRE([AM_MAKE_INCLUDE])
  310.  
  311. AC_CACHE_CHECK([dependency style of $depcc],
  312.                [am_cv_$1_dependencies_compiler_type],
  313. [if test -z "$AMDEP"; then
  314.   # We make a subdir and do the tests there.  Otherwise we can end up
  315.   # making bogus files that we don't know about and never remove.  For
  316.   # instance it was reported that on HP-UX the gcc test will end up
  317.   # making a dummy file named `D' -- because `-MD' means `put the output
  318.   # in D'.
  319.   mkdir confdir
  320.   # Copy depcomp to subdir because otherwise we won't find it if we're
  321.   # using a relative directory.
  322.   cp "$am_depcomp" confdir
  323.   cd confdir
  324.  
  325.   am_cv_$1_dependencies_compiler_type=none
  326.   for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "./depcomp"`; do
  327.     # We need to recreate these files for each test, as the compiler may
  328.     # overwrite some of them when testing with obscure command lines.
  329.     # This happens at least with the AIX C compiler.
  330.     echo '#include "conftest.h"' > conftest.c
  331.     echo 'int i;' > conftest.h
  332.  
  333.     case "$depmode" in
  334.     nosideeffect)
  335.       # after this tag, mechanisms are not by side-effect, so they'll
  336.       # only be used when explicitly requested
  337.       if test "x$enable_dependency_tracking" = xyes; then
  338.     continue
  339.       else
  340.     break
  341.       fi
  342.       ;;
  343.     none) break ;;
  344.     esac
  345.     # We check with `-c' and `-o' for the sake of the "dashmstdout"
  346.     # mode.  It turns out that the SunPro C++ compiler does not properly
  347.     # handle `-M -o', and we need to detect this.
  348.     if depmode="$depmode" \
  349.        source=conftest.c object=conftest.o \
  350.        depfile=conftest.Po tmpdepfile=conftest.TPo \
  351.        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
  352.        grep conftest.h conftest.Po > /dev/null 2>&1; then
  353.       am_cv_$1_dependencies_compiler_type="$depmode"
  354.       break
  355.     fi
  356.   done
  357.  
  358.   cd ..
  359.   rm -rf confdir
  360. else
  361.   am_cv_$1_dependencies_compiler_type=none
  362. fi
  363. ])
  364. $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
  365. AC_SUBST([$1DEPMODE])
  366. ])
  367.  
  368.  
  369. # AM_SET_DEPDIR
  370. # -------------
  371. # Choose a directory name for dependency files.
  372. # This macro is AC_REQUIREd in AM_DEPENDENCIES
  373. AC_DEFUN([AM_SET_DEPDIR],
  374. [if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
  375.   DEPDIR=.deps
  376.   # We redirect because .deps might already exist and be populated.
  377.   # In this situation we don't want to see an error.
  378.   rmdir .deps > /dev/null 2>&1
  379. else
  380.   DEPDIR=_deps
  381. fi
  382. AC_SUBST(DEPDIR)
  383. ])
  384.  
  385.  
  386. # AM_DEP_TRACK
  387. # ------------
  388. AC_DEFUN([AM_DEP_TRACK],
  389. [AC_ARG_ENABLE(dependency-tracking,
  390. [  --disable-dependency-tracking Speeds up one-time builds
  391.   --enable-dependency-tracking  Do not reject slow dependency extractors])
  392. if test "x$enable_dependency_tracking" = xno; then
  393.   AMDEP="#"
  394. else
  395.   am_depcomp="$ac_aux_dir/depcomp"
  396.   if test ! -f "$am_depcomp"; then
  397.     AMDEP="#"
  398.   else
  399.     AMDEP=
  400.   fi
  401. fi
  402. AC_SUBST(AMDEP)
  403. if test -z "$AMDEP"; then
  404.   AMDEPBACKSLASH='\'
  405. else
  406.   AMDEPBACKSLASH=
  407. fi
  408. pushdef([subst], defn([AC_SUBST]))
  409. subst(AMDEPBACKSLASH)
  410. popdef([subst])
  411. ])
  412.  
  413. # Generate code to set up dependency tracking.
  414. # This macro should only be invoked once -- use via AC_REQUIRE.
  415. # Usage:
  416. # AM_OUTPUT_DEPENDENCY_COMMANDS
  417.  
  418. #
  419. # This code is only required when automatic dependency tracking
  420. # is enabled.  FIXME.  This creates each `.P' file that we will
  421. # need in order to bootstrap the dependency handling code.
  422. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
  423. AC_OUTPUT_COMMANDS([
  424. test x"$AMDEP" != x"" ||
  425. for mf in $CONFIG_FILES; do
  426.   case "$mf" in
  427.   Makefile) dirpart=.;;
  428.   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
  429.   *) continue;;
  430.   esac
  431.   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
  432.   # Extract the definition of DEP_FILES from the Makefile without
  433.   # running `make'.
  434.   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
  435.   test -z "$DEPDIR" && continue
  436.   # When using ansi2knr, U may be empty or an underscore; expand it
  437.   U=`sed -n -e '/^U = / s///p' < "$mf"`
  438.   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
  439.   # We invoke sed twice because it is the simplest approach to
  440.   # changing $(DEPDIR) to its actual value in the expansion.
  441.   for file in `sed -n -e '
  442.     /^DEP_FILES = .*\\\\$/ {
  443.       s/^DEP_FILES = //
  444.       :loop
  445.     s/\\\\$//
  446.     p
  447.     n
  448.     /\\\\$/ b loop
  449.       p
  450.     }
  451.     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
  452.        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
  453.     # Make sure the directory exists.
  454.     test -f "$dirpart/$file" && continue
  455.     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
  456.     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
  457.     # echo "creating $dirpart/$file"
  458.     echo '# dummy' > "$dirpart/$file"
  459.   done
  460. done
  461. ], [AMDEP="$AMDEP"
  462. ac_aux_dir="$ac_aux_dir"])])
  463.  
  464. # AM_MAKE_INCLUDE()
  465. # -----------------
  466. # Check to see how make treats includes.
  467. AC_DEFUN([AM_MAKE_INCLUDE],
  468. [am_make=${MAKE-make}
  469. # BSD make uses .include
  470. cat > confinc << 'END'
  471. doit:
  472.     @echo done
  473. END
  474. # If we don't find an include directive, just comment out the code.
  475. AC_MSG_CHECKING([for style of include used by $am_make])
  476. _am_include='#'
  477. for am_inc in include .include; do
  478.    echo "$am_inc confinc" > confmf
  479.    if test "`$am_make -f confmf 2> /dev/null`" = "done"; then
  480.       _am_include=$am_inc
  481.       break
  482.    fi
  483. done
  484. AC_SUBST(_am_include)
  485. AC_MSG_RESULT($_am_include)
  486. rm -f confinc confmf
  487. ])
  488.  
  489. # Like AC_CONFIG_HEADER, but automatically create stamp file.
  490.  
  491. # serial 3
  492.  
  493. # When config.status generates a header, we must update the stamp-h file.
  494. # This file resides in the same directory as the config header
  495. # that is generated.  We must strip everything past the first ":",
  496. # and everything past the last "/".
  497.  
  498. AC_PREREQ([2.12])
  499.  
  500. AC_DEFUN([AM_CONFIG_HEADER],
  501. [AC_CONFIG_HEADER([$1])
  502.   AC_OUTPUT_COMMANDS(
  503.    ifelse(patsubst([$1], [[^ ]], []),
  504.       [],
  505.       [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
  506.        patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
  507.   [am_indx=1
  508.   for am_file in $1; do
  509.     case " $CONFIG_HEADERS " in
  510.     *" $am_file "*)
  511.       echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
  512.       ;;
  513.     esac
  514.     am_indx=\`expr \$am_indx + 1\`
  515.   done])
  516. ])
  517.  
  518. # Add --enable-maintainer-mode option to configure.
  519. # From Jim Meyering
  520.  
  521. # serial 1
  522.  
  523. AC_DEFUN([AM_MAINTAINER_MODE],
  524. [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  525.   dnl maintainer-mode is disabled by default
  526.   AC_ARG_ENABLE(maintainer-mode,
  527. [  --enable-maintainer-mode enable make rules and dependencies not useful
  528.                           (and sometimes confusing) to the casual installer],
  529.       USE_MAINTAINER_MODE=$enableval,
  530.       USE_MAINTAINER_MODE=no)
  531.   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
  532.   AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
  533.   MAINT=$MAINTAINER_MODE_TRUE
  534.   AC_SUBST(MAINT)dnl
  535. ]
  536. )
  537.  
  538. # serial 2
  539.  
  540. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  541. # -------------------------------------
  542. # Define a conditional.
  543. AC_DEFUN([AM_CONDITIONAL],
  544. [AC_SUBST([$1_TRUE])
  545. AC_SUBST([$1_FALSE])
  546. if $2; then
  547.   $1_TRUE=
  548.   $1_FALSE='#'
  549. else
  550.   $1_TRUE='#'
  551.   $1_FALSE=
  552. fi])
  553.  
  554.  
  555. # serial 40 AC_PROG_LIBTOOL
  556. AC_DEFUN(AC_PROG_LIBTOOL,
  557. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  558.  
  559. # Save cache, so that ltconfig can load it
  560. AC_CACHE_SAVE
  561.  
  562. # Actually configure libtool.  ac_aux_dir is where install-sh is found.
  563. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
  564. LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  565. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
  566. DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
  567. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
  568. $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
  569. || AC_MSG_ERROR([libtool configure failed])
  570.  
  571. # Reload cache, that may have been modified by ltconfig
  572. AC_CACHE_LOAD
  573.  
  574. # This can be used to rebuild libtool when needed
  575. LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
  576.  
  577. # Always use our own libtool.
  578. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  579. AC_SUBST(LIBTOOL)dnl
  580.  
  581. # Redirect the config.log output again, so that the ltconfig log is not
  582. # clobbered by the next message.
  583. exec 5>>./config.log
  584. ])
  585.  
  586. AC_DEFUN(AC_LIBTOOL_SETUP,
  587. [AC_PREREQ(2.13)dnl
  588. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  589. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  590. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  591. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  592. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  593. AC_REQUIRE([AC_PROG_RANLIB])dnl
  594. AC_REQUIRE([AC_PROG_CC])dnl
  595. AC_REQUIRE([AC_PROG_LD])dnl
  596. AC_REQUIRE([AC_PROG_NM])dnl
  597. AC_REQUIRE([AC_PROG_LN_S])dnl
  598. dnl
  599.  
  600. case "$target" in
  601. NONE) lt_target="$host" ;;
  602. *) lt_target="$target" ;;
  603. esac
  604.  
  605. # Check for any special flags to pass to ltconfig.
  606. libtool_flags="--cache-file=$cache_file"
  607. test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
  608. test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
  609. test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
  610. test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
  611. test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
  612. ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
  613. [libtool_flags="$libtool_flags --enable-dlopen"])
  614. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  615. [libtool_flags="$libtool_flags --enable-win32-dll"])
  616. AC_ARG_ENABLE(libtool-lock,
  617.   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
  618. test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
  619. test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
  620.  
  621. # Some flags need to be propagated to the compiler or linker for good
  622. # libtool support.
  623. case "$lt_target" in
  624. *-*-irix6*)
  625.   # Find out which ABI we are using.
  626.   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  627.   if AC_TRY_EVAL(ac_compile); then
  628.     case "`/usr/bin/file conftest.o`" in
  629.     *32-bit*)
  630.       LD="${LD-ld} -32"
  631.       ;;
  632.     *N32*)
  633.       LD="${LD-ld} -n32"
  634.       ;;
  635.     *64-bit*)
  636.       LD="${LD-ld} -64"
  637.       ;;
  638.     esac
  639.   fi
  640.   rm -rf conftest*
  641.   ;;
  642.  
  643. *-*-sco3.2v5*)
  644.   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  645.   SAVE_CFLAGS="$CFLAGS"
  646.   CFLAGS="$CFLAGS -belf"
  647.   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  648.     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
  649.   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  650.     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  651.     CFLAGS="$SAVE_CFLAGS"
  652.   fi
  653.   ;;
  654.  
  655. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  656. [*-*-cygwin* | *-*-mingw*)
  657.   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  658.   AC_CHECK_TOOL(AS, as, false)
  659.   AC_CHECK_TOOL(OBJDUMP, objdump, false)
  660.   ;;
  661. ])
  662. esac
  663. ])
  664.  
  665. # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
  666. AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
  667.  
  668. # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
  669. AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
  670.  
  671. # AC_ENABLE_SHARED - implement the --enable-shared flag
  672. # Usage: AC_ENABLE_SHARED[(DEFAULT)]
  673. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  674. #   `yes'.
  675. AC_DEFUN(AC_ENABLE_SHARED, [dnl
  676. define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  677. AC_ARG_ENABLE(shared,
  678. changequote(<<, >>)dnl
  679. <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
  680. changequote([, ])dnl
  681. [p=${PACKAGE-default}
  682. case "$enableval" in
  683. yes) enable_shared=yes ;;
  684. no) enable_shared=no ;;
  685. *)
  686.   enable_shared=no
  687.   # Look at the argument we got.  We use all the common list separators.
  688.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  689.   for pkg in $enableval; do
  690.     if test "X$pkg" = "X$p"; then
  691.       enable_shared=yes
  692.     fi
  693.   done
  694.   IFS="$ac_save_ifs"
  695.   ;;
  696. esac],
  697. enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
  698. ])
  699.  
  700. # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
  701. AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  702. AC_ENABLE_SHARED(no)])
  703.  
  704. # AC_ENABLE_STATIC - implement the --enable-static flag
  705. # Usage: AC_ENABLE_STATIC[(DEFAULT)]
  706. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  707. #   `yes'.
  708. AC_DEFUN(AC_ENABLE_STATIC, [dnl
  709. define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  710. AC_ARG_ENABLE(static,
  711. changequote(<<, >>)dnl
  712. <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
  713. changequote([, ])dnl
  714. [p=${PACKAGE-default}
  715. case "$enableval" in
  716. yes) enable_static=yes ;;
  717. no) enable_static=no ;;
  718. *)
  719.   enable_static=no
  720.   # Look at the argument we got.  We use all the common list separators.
  721.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  722.   for pkg in $enableval; do
  723.     if test "X$pkg" = "X$p"; then
  724.       enable_static=yes
  725.     fi
  726.   done
  727.   IFS="$ac_save_ifs"
  728.   ;;
  729. esac],
  730. enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
  731. ])
  732.  
  733. # AC_DISABLE_STATIC - set the default static flag to --disable-static
  734. AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  735. AC_ENABLE_STATIC(no)])
  736.  
  737.  
  738. # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
  739. # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
  740. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  741. #   `yes'.
  742. AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
  743. define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  744. AC_ARG_ENABLE(fast-install,
  745. changequote(<<, >>)dnl
  746. <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
  747. changequote([, ])dnl
  748. [p=${PACKAGE-default}
  749. case "$enableval" in
  750. yes) enable_fast_install=yes ;;
  751. no) enable_fast_install=no ;;
  752. *)
  753.   enable_fast_install=no
  754.   # Look at the argument we got.  We use all the common list separators.
  755.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  756.   for pkg in $enableval; do
  757.     if test "X$pkg" = "X$p"; then
  758.       enable_fast_install=yes
  759.     fi
  760.   done
  761.   IFS="$ac_save_ifs"
  762.   ;;
  763. esac],
  764. enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
  765. ])
  766.  
  767. # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
  768. AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  769. AC_ENABLE_FAST_INSTALL(no)])
  770.  
  771. # AC_PROG_LD - find the path to the GNU or non-GNU linker
  772. AC_DEFUN(AC_PROG_LD,
  773. [AC_ARG_WITH(gnu-ld,
  774. [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
  775. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  776. AC_REQUIRE([AC_PROG_CC])dnl
  777. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  778. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  779. ac_prog=ld
  780. if test "$ac_cv_prog_gcc" = yes; then
  781.   # Check if gcc -print-prog-name=ld gives a path.
  782.   AC_MSG_CHECKING([for ld used by GCC])
  783.   ac_prog=`($CC -print-prog-name=ld) 2>&5`
  784.   case "$ac_prog" in
  785.     # Accept absolute paths.
  786. changequote(,)dnl
  787.     [\\/]* | [A-Za-z]:[\\/]*)
  788.       re_direlt='/[^/][^/]*/\.\./'
  789. changequote([,])dnl
  790.       # Canonicalize the path of ld
  791.       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  792.       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  793.     ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  794.       done
  795.       test -z "$LD" && LD="$ac_prog"
  796.       ;;
  797.   "")
  798.     # If it fails, then pretend we aren't using GCC.
  799.     ac_prog=ld
  800.     ;;
  801.   *)
  802.     # If it is relative, then search for the first ld in PATH.
  803.     with_gnu_ld=unknown
  804.     ;;
  805.   esac
  806. elif test "$with_gnu_ld" = yes; then
  807.   AC_MSG_CHECKING([for GNU ld])
  808. else
  809.   AC_MSG_CHECKING([for non-GNU ld])
  810. fi
  811. AC_CACHE_VAL(ac_cv_path_LD,
  812. [if test -z "$LD"; then
  813.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  814.   for ac_dir in $PATH; do
  815.     test -z "$ac_dir" && ac_dir=.
  816.     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  817.       ac_cv_path_LD="$ac_dir/$ac_prog"
  818.       # Check to see if the program is GNU ld.  I'd rather use --version,
  819.       # but apparently some GNU ld's only accept -v.
  820.       # Break only if it was the GNU/non-GNU ld that we prefer.
  821.       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  822.     test "$with_gnu_ld" != no && break
  823.       else
  824.     test "$with_gnu_ld" != yes && break
  825.       fi
  826.     fi
  827.   done
  828.   IFS="$ac_save_ifs"
  829. else
  830.   ac_cv_path_LD="$LD" # Let the user override the test with a path.
  831. fi])
  832. LD="$ac_cv_path_LD"
  833. if test -n "$LD"; then
  834.   AC_MSG_RESULT($LD)
  835. else
  836.   AC_MSG_RESULT(no)
  837. fi
  838. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  839. AC_PROG_LD_GNU
  840. ])
  841.  
  842. AC_DEFUN(AC_PROG_LD_GNU,
  843. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
  844. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  845. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  846.   ac_cv_prog_gnu_ld=yes
  847. else
  848.   ac_cv_prog_gnu_ld=no
  849. fi])
  850. ])
  851.  
  852. # AC_PROG_NM - find the path to a BSD-compatible name lister
  853. AC_DEFUN(AC_PROG_NM,
  854. [AC_MSG_CHECKING([for BSD-compatible nm])
  855. AC_CACHE_VAL(ac_cv_path_NM,
  856. [if test -n "$NM"; then
  857.   # Let the user override the test.
  858.   ac_cv_path_NM="$NM"
  859. else
  860.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  861.   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
  862.     test -z "$ac_dir" && ac_dir=.
  863.     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
  864.       # Check to see if the nm accepts a BSD-compat flag.
  865.       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  866.       #   nm: unknown option "B" ignored
  867.       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  868.     ac_cv_path_NM="$ac_dir/nm -B"
  869.     break
  870.       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  871.     ac_cv_path_NM="$ac_dir/nm -p"
  872.     break
  873.       else
  874.     ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
  875.     continue # so that we can try to find one that supports BSD flags
  876.       fi
  877.     fi
  878.   done
  879.   IFS="$ac_save_ifs"
  880.   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
  881. fi])
  882. NM="$ac_cv_path_NM"
  883. AC_MSG_RESULT([$NM])
  884. ])
  885.  
  886. # AC_CHECK_LIBM - check for math library
  887. AC_DEFUN(AC_CHECK_LIBM,
  888. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  889. LIBM=
  890. case "$lt_target" in
  891. *-*-beos* | *-*-cygwin*)
  892.   # These system don't have libm
  893.   ;;
  894. *-ncr-sysv4.3*)
  895.   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  896.   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
  897.   ;;
  898. *)
  899.   AC_CHECK_LIB(m, main, LIBM="-lm")
  900.   ;;
  901. esac
  902. ])
  903.  
  904. # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
  905. # the libltdl convenience library, adds --enable-ltdl-convenience to
  906. # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
  907. # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
  908. # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
  909. # '${top_builddir}/' (note the single quotes!) if your package is not
  910. # flat, and, if you're not using automake, define top_builddir as
  911. # appropriate in the Makefiles.
  912. AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  913.   case "$enable_ltdl_convenience" in
  914.   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  915.   "") enable_ltdl_convenience=yes
  916.       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  917.   esac
  918.   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
  919.   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
  920. ])
  921.  
  922. # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
  923. # the libltdl installable library, and adds --enable-ltdl-install to
  924. # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
  925. # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
  926. # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
  927. # '${top_builddir}/' (note the single quotes!) if your package is not
  928. # flat, and, if you're not using automake, define top_builddir as
  929. # appropriate in the Makefiles.
  930. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  931. AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  932.   AC_CHECK_LIB(ltdl, main,
  933.   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  934.   [if test x"$enable_ltdl_install" = xno; then
  935.      AC_MSG_WARN([libltdl not installed, but installation disabled])
  936.    else
  937.      enable_ltdl_install=yes
  938.    fi
  939.   ])
  940.   if test x"$enable_ltdl_install" = x"yes"; then
  941.     ac_configure_args="$ac_configure_args --enable-ltdl-install"
  942.     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
  943.     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
  944.   else
  945.     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  946.     LIBLTDL="-lltdl"
  947.     INCLTDL=
  948.   fi
  949. ])
  950.  
  951. dnl old names
  952. AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
  953. AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
  954. AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
  955. AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
  956. AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
  957. AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
  958. AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
  959.  
  960. dnl This is just to silence aclocal about the macro not being used
  961. ifelse([AC_DISABLE_FAST_INSTALL])dnl
  962.  
  963.  
  964. # serial 1
  965.  
  966. # @defmac AC_PROG_CC_STDC
  967. # @maindex PROG_CC_STDC
  968. # @ovindex CC
  969. # If the C compiler in not in ANSI C mode by default, try to add an option
  970. # to output variable @code{CC} to make it so.  This macro tries various
  971. # options that select ANSI C on some system or another.  It considers the
  972. # compiler to be in ANSI C mode if it handles function prototypes correctly.
  973. #
  974. # If you use this macro, you should check after calling it whether the C
  975. # compiler has been set to accept ANSI C; if not, the shell variable
  976. # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
  977. # code in ANSI C, you can make an un-ANSIfied copy of it by using the
  978. # program @code{ansi2knr}, which comes with Ghostscript.
  979. # @end defmac
  980.  
  981. AC_DEFUN([AM_PROG_CC_STDC],
  982. [AC_REQUIRE([AC_PROG_CC])
  983. AC_BEFORE([$0], [AC_C_INLINE])
  984. AC_BEFORE([$0], [AC_C_CONST])
  985. dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
  986. dnl a magic option to avoid problems with ANSI preprocessor commands
  987. dnl like #elif.
  988. dnl FIXME: can't do this because then AC_AIX won't work due to a
  989. dnl circular dependency.
  990. dnl AC_BEFORE([$0], [AC_PROG_CPP])
  991. AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
  992. AC_CACHE_VAL(am_cv_prog_cc_stdc,
  993. [am_cv_prog_cc_stdc=no
  994. ac_save_CC="$CC"
  995. # Don't try gcc -ansi; that turns off useful extensions and
  996. # breaks some systems' header files.
  997. # AIX            -qlanglvl=ansi
  998. # Ultrix and OSF/1    -std1
  999. # HP-UX 10.20 and later    -Ae
  1000. # HP-UX older versions    -Aa -D_HPUX_SOURCE
  1001. # SVR4            -Xc -D__EXTENSIONS__
  1002. for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
  1003. do
  1004.   CC="$ac_save_CC $ac_arg"
  1005.   AC_TRY_COMPILE(
  1006. [#include <stdarg.h>
  1007. #include <stdio.h>
  1008. #include <sys/types.h>
  1009. #include <sys/stat.h>
  1010. /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
  1011. struct buf { int x; };
  1012. FILE * (*rcsopen) (struct buf *, struct stat *, int);
  1013. static char *e (p, i)
  1014.      char **p;
  1015.      int i;
  1016. {
  1017.   return p[i];
  1018. }
  1019. static char *f (char * (*g) (char **, int), char **p, ...)
  1020. {
  1021.   char *s;
  1022.   va_list v;
  1023.   va_start (v,p);
  1024.   s = g (p, va_arg (v,int));
  1025.   va_end (v);
  1026.   return s;
  1027. }
  1028. int test (int i, double x);
  1029. struct s1 {int (*f) (int a);};
  1030. struct s2 {int (*f) (double a);};
  1031. int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
  1032. int argc;
  1033. char **argv;
  1034. ], [
  1035. return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  1036. ],
  1037. [am_cv_prog_cc_stdc="$ac_arg"; break])
  1038. done
  1039. CC="$ac_save_CC"
  1040. ])
  1041. if test -z "$am_cv_prog_cc_stdc"; then
  1042.   AC_MSG_RESULT([none needed])
  1043. else
  1044.   AC_MSG_RESULT([$am_cv_prog_cc_stdc])
  1045. fi
  1046. case "x$am_cv_prog_cc_stdc" in
  1047.   x|xno) ;;
  1048.   *) CC="$CC $am_cv_prog_cc_stdc" ;;
  1049. esac
  1050. ])
  1051.  
  1052.  
  1053. # serial 1
  1054.  
  1055. AC_DEFUN([AM_C_PROTOTYPES],
  1056. [AC_REQUIRE([AM_PROG_CC_STDC])
  1057. AC_REQUIRE([AC_PROG_CPP])
  1058. AC_MSG_CHECKING([for function prototypes])
  1059. if test "$am_cv_prog_cc_stdc" != no; then
  1060.   AC_MSG_RESULT(yes)
  1061.   AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
  1062.   U= ANSI2KNR=
  1063. else
  1064.   AC_MSG_RESULT(no)
  1065.   U=_ ANSI2KNR=./ansi2knr
  1066. fi
  1067. # Ensure some checks needed by ansi2knr itself.
  1068. AC_HEADER_STDC
  1069. AC_CHECK_HEADERS(string.h)
  1070. AC_SUBST(U)dnl
  1071. AC_SUBST(ANSI2KNR)dnl
  1072. ])
  1073.  
  1074.  
  1075. # serial 1
  1076.  
  1077. AC_DEFUN([AM_WITH_DMALLOC],
  1078. [AC_MSG_CHECKING([if malloc debugging is wanted])
  1079. AC_ARG_WITH(dmalloc,
  1080. [  --with-dmalloc          use dmalloc, as in
  1081.                           http://www.dmalloc.com/dmalloc.tar.gz],
  1082. [if test "$withval" = yes; then
  1083.   AC_MSG_RESULT(yes)
  1084.   AC_DEFINE(WITH_DMALLOC,1,
  1085.             [Define if using the dmalloc debugging malloc package])
  1086.   LIBS="$LIBS -ldmalloc"
  1087.   LDFLAGS="$LDFLAGS -g"
  1088. else
  1089.   AC_MSG_RESULT(no)
  1090. fi], [AC_MSG_RESULT(no)])
  1091. ])
  1092.  
  1093. # Configure paths for GTK+
  1094. # Owen Taylor     97-11-3
  1095.  
  1096. dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
  1097. dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
  1098. dnl
  1099. AC_DEFUN(AM_PATH_GTK,
  1100. [dnl 
  1101. dnl Get the cflags and libraries from the gtk-config script
  1102. dnl
  1103. AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
  1104.             gtk_config_prefix="$withval", gtk_config_prefix="")
  1105. AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
  1106.             gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
  1107. AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
  1108.             , enable_gtktest=yes)
  1109.  
  1110.   for module in . $4
  1111.   do
  1112.       case "$module" in
  1113.          gthread) 
  1114.              gtk_config_args="$gtk_config_args gthread"
  1115.          ;;
  1116.       esac
  1117.   done
  1118.  
  1119.   if test x$gtk_config_exec_prefix != x ; then
  1120.      gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
  1121.      if test x${GTK_CONFIG+set} != xset ; then
  1122.         GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
  1123.      fi
  1124.   fi
  1125.   if test x$gtk_config_prefix != x ; then
  1126.      gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
  1127.      if test x${GTK_CONFIG+set} != xset ; then
  1128.         GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
  1129.      fi
  1130.   fi
  1131.  
  1132.   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
  1133.   min_gtk_version=ifelse([$1], ,0.99.7,$1)
  1134.   AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
  1135.   no_gtk=""
  1136.   if test "$GTK_CONFIG" = "no" ; then
  1137.     no_gtk=yes
  1138.   else
  1139.     GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
  1140.     GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
  1141.     gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
  1142.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  1143.     gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
  1144.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  1145.     gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
  1146.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  1147.     if test "x$enable_gtktest" = "xyes" ; then
  1148.       ac_save_CFLAGS="$CFLAGS"
  1149.       ac_save_LIBS="$LIBS"
  1150.       CFLAGS="$CFLAGS $GTK_CFLAGS"
  1151.       LIBS="$GTK_LIBS $LIBS"
  1152. dnl
  1153. dnl Now check if the installed GTK is sufficiently new. (Also sanity
  1154. dnl checks the results of gtk-config to some extent
  1155. dnl
  1156.       rm -f conf.gtktest
  1157.       AC_TRY_RUN([
  1158. #include <gtk/gtk.h>
  1159. #include <stdio.h>
  1160. #include <stdlib.h>
  1161.  
  1162. int 
  1163. main ()
  1164. {
  1165.   int major, minor, micro;
  1166.   char *tmp_version;
  1167.  
  1168.   system ("touch conf.gtktest");
  1169.  
  1170.   /* HP/UX 9 (%@#!) writes to sscanf strings */
  1171.   tmp_version = g_strdup("$min_gtk_version");
  1172.   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
  1173.      printf("%s, bad version string\n", "$min_gtk_version");
  1174.      exit(1);
  1175.    }
  1176.  
  1177.   if ((gtk_major_version != $gtk_config_major_version) ||
  1178.       (gtk_minor_version != $gtk_config_minor_version) ||
  1179.       (gtk_micro_version != $gtk_config_micro_version))
  1180.     {
  1181.       printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
  1182.              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
  1183.              gtk_major_version, gtk_minor_version, gtk_micro_version);
  1184.       printf ("*** was found! If gtk-config was correct, then it is best\n");
  1185.       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
  1186.       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  1187.       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  1188.       printf("*** required on your system.\n");
  1189.       printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
  1190.       printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
  1191.       printf("*** before re-running configure\n");
  1192.     } 
  1193. #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
  1194.   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
  1195.        (gtk_minor_version != GTK_MINOR_VERSION) ||
  1196.            (gtk_micro_version != GTK_MICRO_VERSION))
  1197.     {
  1198.       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
  1199.          GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
  1200.       printf("*** library (version %d.%d.%d)\n",
  1201.          gtk_major_version, gtk_minor_version, gtk_micro_version);
  1202.     }
  1203. #endif /* defined (GTK_MAJOR_VERSION) ... */
  1204.   else
  1205.     {
  1206.       if ((gtk_major_version > major) ||
  1207.         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
  1208.         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
  1209.       {
  1210.         return 0;
  1211.        }
  1212.      else
  1213.       {
  1214.         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
  1215.                gtk_major_version, gtk_minor_version, gtk_micro_version);
  1216.         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
  1217.            major, minor, micro);
  1218.         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
  1219.         printf("***\n");
  1220.         printf("*** If you have already installed a sufficiently new version, this error\n");
  1221.         printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
  1222.         printf("*** being found. The easiest way to fix this is to remove the old version\n");
  1223.         printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
  1224.         printf("*** correct copy of gtk-config. (In this case, you will have to\n");
  1225.         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  1226.         printf("*** so that the correct libraries are found at run-time))\n");
  1227.       }
  1228.     }
  1229.   return 1;
  1230. }
  1231. ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  1232.        CFLAGS="$ac_save_CFLAGS"
  1233.        LIBS="$ac_save_LIBS"
  1234.      fi
  1235.   fi
  1236.   if test "x$no_gtk" = x ; then
  1237.      AC_MSG_RESULT(yes)
  1238.      ifelse([$2], , :, [$2])     
  1239.   else
  1240.      AC_MSG_RESULT(no)
  1241.      if test "$GTK_CONFIG" = "no" ; then
  1242.        echo "*** The gtk-config script installed by GTK could not be found"
  1243.        echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
  1244.        echo "*** your path, or set the GTK_CONFIG environment variable to the"
  1245.        echo "*** full path to gtk-config."
  1246.      else
  1247.        if test -f conf.gtktest ; then
  1248.         :
  1249.        else
  1250.           echo "*** Could not run GTK test program, checking why..."
  1251.           CFLAGS="$CFLAGS $GTK_CFLAGS"
  1252.           LIBS="$LIBS $GTK_LIBS"
  1253.           AC_TRY_LINK([
  1254. #include <gtk/gtk.h>
  1255. #include <stdio.h>
  1256. ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
  1257.         [ echo "*** The test program compiled, but did not run. This usually means"
  1258.           echo "*** that the run-time linker is not finding GTK or finding the wrong"
  1259.           echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
  1260.           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  1261.           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
  1262.           echo "*** is required on your system"
  1263.       echo "***"
  1264.           echo "*** If you have an old version installed, it is best to remove it, although"
  1265.           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  1266.           echo "***"
  1267.           echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
  1268.           echo "*** came with the system with the command"
  1269.           echo "***"
  1270.           echo "***    rpm --erase --nodeps gtk gtk-devel" ],
  1271.         [ echo "*** The test program failed to compile or link. See the file config.log for the"
  1272.           echo "*** exact error that occured. This usually means GTK was incorrectly installed"
  1273.           echo "*** or that you have moved GTK since it was installed. In the latter case, you"
  1274.           echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
  1275.           CFLAGS="$ac_save_CFLAGS"
  1276.           LIBS="$ac_save_LIBS"
  1277.        fi
  1278.      fi
  1279.      GTK_CFLAGS=""
  1280.      GTK_LIBS=""
  1281.      ifelse([$3], , :, [$3])
  1282.   fi
  1283.   AC_SUBST(GTK_CFLAGS)
  1284.   AC_SUBST(GTK_LIBS)
  1285.   rm -f conf.gtktest
  1286. ])
  1287.  
  1288.